import request from "@/utils/request";

export const addApi = (data: any) => {
  return request({
    url:'/tableInfo/add', 
    method: 'POST',
    data: data,
  });
}

export const selectListApi = (data: any) => {
  return request({
    url:'/tableInfo/selectList', 
    method: 'POST',
    data: data,
  });
}

export const deleteApi = (id: number) => {
  return request({
    url:'/tableInfo/delete', 
    method: 'POST',
    data: {
      ids:[id]
    },
  });
}
export const updateApi = (data: any) => {
  return request({
    url:'/tableInfo/update', 
    method: 'POST',
    data: data,
  });
}




export const selectOneApi = (data: any) => {
  return request({
    url:'/tableInfo/selectOne', 
    method: 'POST',
    data: data,
  });
}
    
export const addFieldBatchApi = (data: any) => {
  return request({
    url:'/fieldInfo/addBatch', 
    method: 'POST',
    data: data,
  });
}
    

export const selectByParentIdApi = (parentId:number) => {
  return request({
    url:'/fieldInfo/selectByParentId', 
    method: 'POST',
    data: {parentId},
  });
}
    
    
export const createCodeApi = (data: any) => {
  return request({
    url:'/tableInfo/createCode', 
    method: 'POST',
    data: data,
  });
}
    